package com.distributer.policy.request;

import com.distributer.policy.model.InsurancePolicy;
import com.distributer.policy.service.InsurancePolicyService;

public class PolicyAddRequest implements Request{

	private final InsurancePolicyService insurancePolicyService;
	
	private final InsurancePolicy insurancePolicy;
	
	public PolicyAddRequest(InsurancePolicyService insurancePolicyService,InsurancePolicy insurancePolicy){
		this.insurancePolicyService = insurancePolicyService;
		this.insurancePolicy = insurancePolicy;
		this.insurancePolicy.init();
	}
	
	@Override
	public void prosess() {
		//直接新增到数据库中即可
		insurancePolicyService.addPolicy(insurancePolicy);
	}

	@Override
	public String getJbPolicyNo() {
		return this.insurancePolicy.getJbPolicyNo();
	}

	
}
